const state = {
  bigidarr: []
}
// getters
const getters = {}

// actions
const actions = {
  del_item({ commit }, id) {
    commit('delItem', id)
  },
  set_item({ commit }, id) {
    commit('setPrint', id)
  },
  get_item({ commit }, id) {
    commit('getItem', id)
  },
  qingkong_item({ commit }, id) {
    commit('qikongItem', id)
  }
}

// mutations
const mutations = {
  getItem(state, id) {
    console.log(state.bigidarr)
  },
  setPrint(state, all) { // 设置参数
    state.bigidarr.push(...all)
  },
  qikongItem(state, id) {
    state.bigidarr = []
  },

  delItem(state, id) {
    const arr = state.bigidarr
    arr.forEach((item, index) => {
      if (id === item) {
        state.bigidarr.splice(index, 1)
        console.log('删除的', state.bigidarr)
      }
    })
  }

}
export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
